package com.nativetalk.dao;

import com.nativetalk.base.Page;
import com.nativetalk.bean.SearchCourseAndWeikeResponseDto;
import com.nativetalk.bean.TsNtCategory;
import com.nativetalk.bean.course.TdNtCoursePictureList;
import com.nativetalk.bean.course.TsNtCourseInfoDetail;
import com.nativetalk.bean.course.TsNtCourseInfoList;
import com.nativetalk.dto.ExperienceCourseDto;
import com.nativetalk.dto.weike.Weike;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by lizhun on 16/2/24.
 * Modified by wangzheng on 17/02/16
 */
@MyBatisRepository
public interface TsNtCourseInfoDao {
    /**
     * @Purpose  更新课程已学人数
     * @version  1.0
     * @author   lizhun
     * @param    map
     * @return   void
     */
    public void updateTsNtCourseInfoStudySize(Map<String, Object> map);
    /**
     * @Purpose  查找课程数量
     * @version  4.0
     * @author   lizhun
     * @param    page
     * @return   int
     */
    public int findCourseSize(Page page);
    /**
     * @Purpose  分页查找课程
     * @version  4.0
     * @author   lizhun
     * @param    page
     * @return   List<TsNtCourseInfoList>
     */
    public List<TsNtCourseInfoList> findCoursePage(Page page);

    /**
     * @Purpose  根据课程类别id查找课程信息
     * @version  4.1
     * @author   wangzheng
     * @param    cateIds
     * @return   List<TsNtCourseInfoDetail>
     */
    public List<TsNtCourseInfoDetail> findTsNtCourseInfoIndexByCateIds(List<Integer> cateIds);

    /**
     * @Purpose 查询学生购买的、有效的、可预约课时数大于0的套餐对应的课程信息
     * @version  4.1
     * @author   wangzheng
     * @param    memb_id
     * @return   List<TsNtCourseInfoDetail>
     */
    public List<TsNtCourseInfoDetail> findBookableCourseInfo(Integer memb_id);

    /**
     * @Purpose 根据课程id查找课程信息
     * @Version 4.2
     * @author  wangzheng
     * @param   cou_id
     * @return  TsNtCourseInfoDetail
     */
    public TsNtCourseInfoDetail findCourseByCouId(int cou_id);

    //查询微课
    List<Weike> searchWeike(Page page);

    Integer searchWeikeCount(Page page);


    Integer searchCourseAndWeikeCount(Page page);

    List<SearchCourseAndWeikeResponseDto> searchCourseAndWeike(Page page);

    List<Integer> findExperiencedCourseIds(Integer memb_id);

    List<ExperienceCourseDto> findByCateId(@Param("pojo") TsNtCategory pojo);

    List<TsNtCourseInfoDetail> findTeacherOpenCourse(int tea_id);

    List<TdNtCoursePictureList> findCoursePicture(Integer cou_id);
}
